import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';

export type ArticlePageParam = BasicPageParams & {
  status?: string;
  recommended?: number;
  random?: number;
  recentFlag?: number;
  url?: string;
  keywords?: string;
  title?: string;
  category?: string;
  categoryId?: number;
  tagId?: number;
  sortName?: string;
  sortOrder?: string;
};

export type TagPageParam = BasicPageParams;
export type CategoryPageParam = BasicPageParams;
export type CommentPageParam = BasicPageParams & {
  id?: string;
  entityType?: number;
  entityId?: string;
  targetId?: string;
  userId?: string;
  status?: number;
};
export type SignEventPageParam = BasicPageParams & {
  eventName?: string;
};
export type SignAttendancePageParam = BasicPageParams & {
  username?: string;
  eventName?: string;
};
export type SignPointPageParam = BasicPageParams & {
  username?: string;
};

/**
 * ListItem
 */
export interface ArticleListItem {
  id?: number;
  type?: number;
  title?: string;
  summary?: string;
  content?: string;
  status?: number;
  hidden?: number;
  url?: string;
  thumbnail?: string;
  views?: number;
  gmtCreated?: string;
  gmtModified?: string;
  recommended?: number;
  keywords?: string;
  categoryId: number;
}

export interface TagListItem {
  id?: number;
  name?: string;
  url?: string;
  fix?: number;
  seq?: number;
  count?: number;
}

export interface CategoryListItem {
  id?: number;
  name?: string;
  url?: string;
  description?: string;
}

/**
 * AddParam
 */
 export type CategoryAddParam = {
  name?: string;
  url?: string;
  description?: string;
};

export type TagAddParam = {
  id?: number;
  name?: string;
  url?: string;
  fix?: number;
  seq?: number;
};


/**
 * UpdatedParam
 */
export type TagUpdatedParam = {
  id?: string;
};
export type CategoryUpdatedParam = {
  id?: string;
};
export type CommentUpdatedParam = {
  id?: string;
  content?: string;
};
export type SignAttendanceUpdatedParam = {
  id?: string;
};
export type SignEventUpdatedParam = {
  id?: string;
};
export type SignPointUpdatedParam = {
  id?: string;
};

/**
 * @description: Request list return value
 */
export type ArticleListGetResultModel = BasicFetchResult<ArticleListItem>;

export type TagPageListGetResultModel = BasicFetchResult<TagListItem>;

export type CategoryPageListGetResultModel = BasicFetchResult<CategoryListItem>;

export type SignEventPageListGetResultModel = BasicFetchResult<SignEventListItem>;

export type SignAttendancePageListGetResultModel = BasicFetchResult<SignAttendanceListItem>;

export type SignPointPageListGetResultModel = BasicFetchResult<SignPointListItem>;
